Tutorial Contents

Recording and stimulation

Common interface features

Microphone Arduino DataTranslation (MCC)

Configurations

Contents

Recording and Stimulation

DataView can currently record through 3 device sources:

Data acquired through DataView are stored in files with the extension dtvw-rec (legacy dtx files can still be read).

Common Interface Features

Each recording device shares several common interface features. There is a main view in which recorded data are displayed, a toolbar above the view which controls starting and stopping the recording, and a tabbed property page dialog box on the left that sets recording (and sometimes stimulating) parameters.

We will use the microphone facility to illustrate basic recording features. If your computer has a built-in microphone you can use it immediately. If not, you will either have to connect an external microphone (or at least put a jack into the microphone socket), or just follow the instructions in your imagination.

Microphone Input

The microphone input on a computer provides 1- or 2-channel AC-coupled recording at ADC rates up to 44 kHz. This can be used with an extracellular amplifier (e.g. Backyard Brains) to record neural signals, or with an actual microphone or any other equivalent voltage source. The input amplification level is controlled by the computer itself and is usually not quantified.

The following dialog should open:

Microphone recording interface
The microphone recording interface.

Recording

Recording is started by clicking the Start toolbar button. Data are stored in a temporary disk file which allows them to be reviewed, but for permanent storage the user must click the Save button. The temporary file is deleted after each recording session.

The recording mode can be either single-sweep, refresh or scroll.

Single sweep: A single screen of data are acquired. The user sets the recording duration by editing the right-hand time-base (X-axis) scale in the display, or equivalently, the time-per-division scale.

Refresh: Sweeps of data are acquired repetitively and the display is cleared between each sweep. Recording continues until the user clicks the Stop toolbar button, or the user-set Time limit is reached. Recording progress is indicated in the read-only Time done box.

Scroll: The data scroll in continuously from the right-hand side of the screen. Again, recording continues until the user clicks the Stop toolbar button, or the user-set Time limit is reached.

The Time limit is to ensure that the temporary file generated during recording cannot inadvertently occupy too much of the available disk space (for instance if you leave the recording running over a weekend). You can set the limit to a large value if you know that you want to record for several hours.

Trace Gain and Position, and Display Time-base

You can change the trace gain and position while recording using the standard toolbar buttons attached to the main frame window, just like with any other DataView display. In refresh and scroll modes you can also change the time-base of the display by clicking the compress or expand main toolbar buttons.

Pause Display

You can review data that has already been recorded while continuing to record new data in the background, by checking the Pause box.  You can then use the navigation toolbar buttons to move back and forth through recorded data. To resume updating the display with new data, uncheck the box. Note that any changes to the time-base made while reviewing data will be reset back to the original recording value when the update resumes. 

Multi-Threading

Recording and disk storage take place in a separate background thread relative to display and analysis, so even lengthy display operations in Pause mode should not cause dropped data.

Markers

While recording you can press any letter or number on the keyboard and that character will be entered as a marker into the recording. The markers will not be visible until you Stop or Pause the recording. 
Note that if you click Pause, you will have to click somewhere in the display area afterwards to reset the focus to the main window if you want to add further markers (or else your computer will just go ping! when you press a key).

Monitor

Monitor is similar to Start, except that data are not stored in a temporary file, and cannot be saved. The monitor mode is for setting up and checking recording parameters, or for a long-term demonstration (such as a laboratory class) where data are not intended for saving.

Try-out

Read through the following instructions before you start, so that you know what you are going to be doing.

Triggered Scope

The main recording view is rather like a traditional chart recorder, especially when it operates in Scroll mode. You can simultaneously display a fast time-base Scope view.

When the Scope first displays it operates in auto trigger mode, which means as soon as one sweep finishes the next starts. This mode allows you to observe the data as it is acquired.

A Scope sweep is now only triggered when the data in the selected trace crosses threshold in the selected direction. This is a good way of observing the waveform of individual spikes. By default the trigger point is set mid-way through the sweep, so that an equal length of pre- and post-trigger data are displayed. However the trigger point can be shifted with the < or > buttons, and the sweep duration can be compressed or expanded with the >< and <> buttons.

Saving data

Data are initially stored in a temporary file so that they can be reviewed, but unless they are explicitly saved they will be lost when the next recording starts or the program exits. Click the Save button to save the data. The drop-down arrow on the button exposes a menu with two options: Save visible and Save all. Save visible just saves the data displayed in the screen (which of course can be adjusted with the navigation buttons). This means that a very long recording can be made, and then selected regions of interest within this recording can be saved to separate, short, files. The Save all option saves the entire recording and deletes the temporary file.

Data recorded through the microphone input can be saved in one of two file formats by selecting from the Save as type drop-down list in the Save dialog box. The dtvw-rec format is the native format for DataView recordings. Alternatively, data can be saved in the Microsoft wav format. In the latter case a header file with dtvw-hdr extension is also saved to contain DataView-specific information such as the marker.

Quality

The Quality tab enables you to set the AD sample rate to one of the standard audio options. The default 22.05 kHz is usually suitable for most extracellular recordings. The data can be acquired with either 8-bit or 16-bit resolution, but the default 16-bit is normally the best choice. The recording can be either mono (1 channel) or stereo (2 channels), although the stereo option may not be functional on some computers, depending on the microphone input type.

Arduino

The very inexpensive Arduino Uno provides 0-5 V DC-coupled recording of up to 4 channelsThe board itself has 6 channels, but the DataView software is limited to 4., with 10-bit (1024 voltage bins) resolution. The maximum ADC rate supported by DataView is 5 kHz for single channel recording, multiplexed for multichannels.

Setup

If you have a new Arduino-type microcontroller and have not previously used one with DataView, follow these steps to get started:

  1. Download, install, and open the standard Arduino IDE (integrated development environment).
    1. Install all the drivers it offers.
  2. Connect the Arduino board to your computer and wait while Windows configures the driver.
  3. Run one of the standard example sketches supplied with the IDE to make sure that everything is working.
  4. Install the Arduino TimerOne library:
    1. Activate the Sketch: Include Library: Manage library menu command in the IDE
    2. Scroll down to find TimerOne in the listing (Jesse Tane is the primary author, I think)
    3. Click on this and follow the instructions to install it. There is more information on installing libraries here.
  5. Open the file dv_ard.ino and loadYou can download it from your browser as a file and load it into the IDE, or copy-and-paste it directly. it into the Arduino IDE.
    The sketch code is also given here in case your browser objects to opening an ino file from the internet.
  6. Verify that the sketch compiles.
  7. Check that the IDE has the correct port setting for your board.
  8. Upload the sketch to the board.

Once a sketch has been uploaded to a board, it will persist even if the board is unplugged. However, if you reset the board (or upload a different sketch), you will have to re-upload the dv_ard sketch.

Once the dv_ard sketch is installed on the Arduino board, that board can interact with any computer running DataView. You do not have to install the Arduino IDE and library on every computer that uses the Arduino-DataView combination. Since the Arduino board is very inexpensive this makes the Arduino-DataView combination a good choice for classroom use if you need a cheap DC digital chart-recorder.

If you want to install dv_ard on multiple Arduino boards (e.g. for a class practical) and you try to upload the sketch to each board in turn from single computer, you may find that Windows advances the com port ID number with each board, which means that the number can get large. This is because each time Windows sees a new device with a serial port (or each time one without a unique id is unplugged/replugged), it permanently allocates a serial port number. At the moment DataView cannot access Com ports with ID higher than 9. You can remove the unused Com port IDs by following the instructions given here, or using the steps below:

  1. Right-click “Command Prompt” in Windows, Accessories on the Start menu, and choose “Run as Administrator”.
  2. Enter “set devmgr_show_nonpresent_devices=1″at the prompt – without the quotes, obviously.
  3. Enter “start devmgmt.msc”.
  4. In the dialog box that opens, select “Show hidden devices” in the ‘View’ menu.
  5. Now if you expand the section on COM ports, all the COM ports that have ever been created will be displayed, the non present ones being in grey. You can
    uninstall anything that you don’t want (right click, select uninstall).
  6. Note: uninstall, but do not delete the driver
So after uploading the sketch to a particular Arduino board, unplug it, uninstall the com port (e.g. COM5) and plug in the next board, which will then be on COM5 rather than COM6.

Recording and Saving

See the Common Interface Features for further details of recording and saving.

DataTranslation (DT) Boards

DataView supports Measurement Computing (formerly DataTranslation) ADC-DAC boards through the Open Layers programming interface. The exact facilities available depend on the hardware capabilities of the board, but the more expensive boards have high specifications and are fully suitable for research use.

Note: I have used DataView with the DT9818 and 9812 boards. According to MC, the OpenLayers protocol allows software to control any of the DT boards. However, before purchasing an expensive board other than one of the two listed above, I would recommend that you ask MC for a test trial to confirm that it does indeed work as you expect.

The following general specifications apply to the DataView interface.

Input: Data can be acquired on up to 16 channels, with all channels acquiring at the same ADC rate. Acquisition can be triggered either manually, or in response to an external TTL electronic pulse, or at timed intervals.

Episodes: A single DataView acquisition file contains one or more episodes of recording, with each episode having a user-determined duration, and with each episode starting when trigger conditions are met. If the file contains more than one episode, then the start time of each episode is marked by an event in channel a.

Output: Stimuli can be output through up to 16 channels, each at the same DAC rate, which can be independent of the ADC rate. Output can take the form of an arbitrary number of pulses with optional on- and off-ramps, or an arbitrary waveform held in a native DataView dtvw-dat format file. Output is initiated at the same time and in response to the same trigger as input.

Simultaneous Recording and Stimulating

Many DT boards claim “simultaneous start” capability for input and output systems, but this is software-implemented and is only accurate to within a few clock cycles (at least, this is the case for the DT9818 board that I used). For many electrophysiological applications this is not adequate; the stimulus needs to be very precisely timed relative to data acquisition. This can be achieved by using a single “external” digital trigger to activate both ADC and DAC systems. This usually does not require a separate piece of electronic hardware since many DT boards (like the DT9818) provide a digital i/o facility which can be used to generate this trigger.

DataView  has a “use d/o + ext trigger” checkbox option which becomes available for boards that provide digital i/o. To use this you should make a hard-wired connection between the first digital output (bit 0) and the external trigger inputs for both the ADC and DAC systems. DataView then configures these for external triggering, and starts each acquisition/stimulus cycle by outputting a pulse from bit 0 of the digital i/o channel. This pulse triggers the start of analogue input and output virtually synchronously. In actuality, the AD system seems to start one clock cycle before the DA system, so you may acquire one data sample before the DA output starts.

First Use

Software drivers and the board should be installed/connected as per the manufacturer’s instructions prior to first use, and the digital i/o, if used, should be wired as above. After installation, the recording and stimulating facilities become available through the File: Record/stimulate: DT board menu command.

General Purpose

The general purpose interface, as its name suggests, provides a wide range of a facilities for general recording and stimulating.

Recording with the DT9812 board
Recording interface for the DataTranslation series of ADC-DAC boards. The Acquisition control tab is open.

The figure above shows a recording made with a DT9812 board, which is one of the less expensive ADC-DAC boards available. Single sweep was selected as the acquistion mode, with a sweep duration of 40 ms. All other control parameters were left at their default values. I simply started the system, put my finger on the input terminal of the first data channel to generate some mains interference (50 Hz, being the UK), and then clicked the Start button. The recorded data are displayed in the main view to the right, while recording and stimulating parameters are controlled through the dockable tabbed Control page to the left. Input, output and save options are controlled using buttons in the toolbar above the main view.

See the Common Interface Features for details of recording and saving data.

I will now describe the controls available on the various tabbed pages, and this will give more details about what can be done with DataView.

a
DataTranslation recording Input tab
b
DataTranslation recording Trigger tab
c
DataTranslation recording Output tab

Control tabs for recording and stimulating with DT boards. The options that are available (enabled) depend upon the hardware facilities of the particular board that has been installed. a. The Input tab specifies which recording channels are active and their internal (board-specific) gain, and the acquisition frequency. b. The Trigger tab specifies the conditions that control the start time of a recording. c. The Output tab specifies analog output. This is empty by default, but for illustration has been configured to deliver three square wave pulses.

Details of these facilities are described in the text.

Input Options

Recording parameters are set using the Acquisition, Input and Trigger tabs on the control page.

Acquisition tab

Acquisition duration – Sweep mode

Single sweep: The episode duration is set in milliseconds by the right-hand timebase scale of the acquisition view, and for each trigger a single sweep of data is acquired.

Continuous: In Refresh or Scroll mode the episode duration is set in seconds by the Time limit edit box. In Refresh mode each sweep replaces the previous one, while in Scroll mode the data scroll to the left as soon as a complete sweep is achieved.

In Refresh or Scoll modes, the display update can be Paused during acquisition. Data continue to be recorded to disk in the background, but the screen does not update. This allows the user to scroll through the view to examine data recorded earlier in the same episode. This can be useful if making a very long recording. When the Pause option is de-selected, the display update resumes.

Save options

If the Auto-load box is checked, then as soon as data are saved they are re-loaded into the main view. If it is not checked, then you have to load files explicitly if you want to display them.

Manual save, no append: Each episode of data acquisition has to be saved explicitly by clicking the Save button.

Manual save + append: You save the first episode that you want to keep by clicking the Save button. Subsequent episodes can be appended to the same file if desired by clicking the Append button (which appears in the toolbar after the first save), or discarded by acquiring another episode. The file is finalized by clicking the Done button, which appears in the toolbar when this acquisition mode is selected. After this the file is available for analysis and no further episodes can be appended.

Auto save + append: In this mode you specify a pre-set filename before you start acquisition. Each episode is then automatically appended to this file without further intervention. This is particularly useful in Timer repeat mode (see below), in which a series of episodes can be acquired at fixed intervals, while you go off for lunch. However, you sacrifice the ability to discard episodes containing unwanted data in this mode.

In the Append modes the new file is automatically loaded and displayed immediately after saving the first episode. The data can be examined using the usual facilities. Subsequent episodes are appended to the end of this file. If the Show latest episode option is checked, then the view automatically updates to bring this on screen. If you do not want this (if you are reviewing earlier episodes, for instance), then uncheck the box. The file remains available for appending as long as it is open until the Done button is clicked.

Auto save, no append: This mode is similar to Auto save + append, except that each episode is written to a separate file, rather than appended onto a single file. Again, you select a starting filename, and then this name is automatically incremented after each episode.

Input tab

Check the On box for channels on which you wish to acquire data. Optionally, choose a channel Gain from the drop-down list.

Select the recording mode as Single ended or Differential.

Set the desired acquisition frequency (ADC sample rate) in the edit box at the bottom of the tab. You may not acquire at exactly the frequency you specify, depending on the board capability, but this value will update to the actual acquisition frequency used after the first cycle of acquisition.

The availability of options depends on the capability of the board in use.

Trigger tab

Manual single-shot: With this trigger option selected, you start each episode of acquisition by clicking the Start button. A single episode of data is acquired, and then the system stops.

Timer repeat: In this mode you set the Count of the number of episodes that you want to acquire, and you set the Interval between the start of each acquisition. The first episode is acquired as soon as you click Start, and subsequent episodes are acquired at the set interval.

External trigger: With this option selected, you arm the system by clicking Start, but actual acquisition does not start until the external trigger condition is met.

Output Options

DataView can output up to 16 channels depending on your hardware. The output can be either in the form of arbitrary waveforms stored in standard DataView dtvw-dat files, or pulses with optional on- and off- ramps and a DC level. A sequence-controller can change any combination of pulse parameters through a sequence of steps, advancing one step through the sequence with each acquisition. The parameters are controlled from the Output tab.

Synchronizing input and output

To get the most accurate synchronization of input and output, check the Use d/o + ext trig box in the Trigger tab and wire bit 0 of the digital output to the external triggers of both the AD and DA subsystems as described in the section Simultaneous Recording and Stimulating above.

Steady-State Output

DataTranslation boards should default to 0 output on start-up. After outputting a series of data values, the DA channels should “stick” at the last value output from that channel.

NOTE: at the moment when outputting from multiple DA channels, they all seem to stick at the last value output from the highest channel ID, rather than at the last value output from each channel individually. This is not a problem if you define each output channel to have the same final output, but it may be a problem if you wish the channels to finish with different DC outputs. This seems to be a bug in the DT driver software, and hopefully it will be corrected by the manufacturer at some time in the future.

Output tab

You need to specify at least 1 output channel if you want to output anything!

Simple pulse

This outputs a train of one or more identical square-wave pulses, superimposed on a DC offset if desired.
To prepare for pulse output do the following.

To specify the output

Advanced pulse

This outputs a train of one or more pulses, superimposed on a DC offset if desired. The pulses can be configured individually.
To prepare for pulse output do the following.

To add a new pulse, carry out the following steps.

Repeat until you have set up as many pulses as you wish. Note that pulses which overlap in time will add together, and that pulses add on to any DC level that you set.

Pulses are assigned ID numbers in the sequence in which they are added (not the sequence in which they are output).

To edit an existing pulse, carry out the following steps.

Sequence control

You can set up a sequence control so that every time you acquire an episode of data, specific pulse parameters are stepped by a specified values. Note that you need to uncheck the Pause box to enable the sequence to advance. The current Sequence count is shown at the right hand end of the View toolbar.

To set up a sequence, first use the Edit channel and Edit pulse controls to select the pulse whose parameters you want to step. You can step parameters on multiple pulses simultaneously, but you have to set them up one at a time. Now click the Sequence button to display the Pulse sequence dialog box, and do the following.

You can pause the sequence by checking the Pause box on the Output tab. This prevents the Sequence count from advancing  and causes the pulse parameters to stick at their current values. Note that this box is checked by default; to allow the sequence to advance you need to uncheck the box.

You can reset the sequence so that parameters return to their starting values by clicking the Reset button.

Waveform

If you have a previously-recorded or constructed data file containing one or more waveforms, you can output this through the hardware DAC. Each trace in the source file is output through a separate DAC channel, up to the available hardware limit. The output frequency will be set to the nearest allowed value to the source file sample rate, although it can be adjusted manually if desired.
Note that the source data has to be held in memory for output, so if you try to output a very long source file, you may run out of memory.

Configurations

If you have an acquisition system running, the File: Save config menu command allows you to save a complete set of recording and stimulation parameters to a file, while the File: Load config menu command restores recording and stimulating parameters to a previously-saved set of values. Configuration files are specific for the recording device – microphone, Arduino or DataTranslation board. In the latter case it is obviously important not to load a configuration file into a system using a DT board with less capable hardware than that which was present when the configuration file was saved.

If you do not currently have an acquisition system running, the File: Record/Stimulate: Load from config menu command activates the recording interface for the appropriate device directly.